package com.feng.util;

import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.stereotype.Service;
@Service
public class SetEmail {

    public  void setEmail(String email,String msg,JavaMailSenderImpl mailSender){

        // 一个简单的邮件
        SimpleMailMessage mailMessage = new SimpleMailMessage();
        mailMessage.setSubject("校园卡app");
        mailMessage.setText("您的验证码为"+msg);
        mailMessage.setTo(email);
        mailMessage.setFrom("3053836553@qq.com");
        mailSender.send(mailMessage);
    }
}
